Classic XY Problem.
Your attempted solution:
No information whatsoever about your actual problem:
I don’t suppose your recent topic is related?