fix fullscreen functionality, add check for edge case