Fixed crash with rotation