Added condition to refresh map if it becomes null