This does not work 100% of the time. It seems that it works for the few seconds of the frame or the first couple of touches for the screen, but the condition fails after this