updated rotation handling