Since this happens sporadically, it may be an issue with reserved words. LOCKSCREEN is a reserved word, and it is good practice to avoid naming user defined functions after reserved words. The odd thing about using reserved words is they may work correctly some or most of the time, but fail under specific circumstances. I'm not familiar with the Mere Mortals framework, but from your code it looks like LOCKSCREEN() is something in the framework code.
Jim
Jim Saunders
Microsoft
This posting is provided “AS IS”, with no warranties, and confers no rights.