fix map issues when switching from one view to another