fixing a orientation change bug in iOS