Fixed the rotate issue

So it can support different orientations, works both for iPhone and iPad.