improve rotation handling