corrected bug when the browser was in landscape and swip to dismiss was not working, switched back to using UIDeviceOrientation, code cleanup