Fix orientation change bug

Fixes Issue #1 of original repo