Fixed crash when turning device