Fix crash on rotate