I thought we already switched to another approach!?
What about this:
Regardless of that - without more detailed information we are pretty much unable to give a meaningful recommendation. None of the code is actually influenced by the lock state of a computer.