fix crash when rotating the map