(fix) map not being destroyed when switching to other states