optimizing fullscreen functionality