Fixing orientation switch issue