fix crash on rotate