Fixed switching orientations while view was hidden