Handle orientation correctly