fix screensaver logic in win. mac support(not tested)