proper handling for rotation