Somehow fix crash when exiting map