fixed code the restores state when EHHapp is run in fullscreen