Added some support for orientation changes in iPad