fixed crash when rotating