fixed crash on rotate