Handle orientation changes
Merge pull request #1091 from jjxtra/master

Handle orientation changes