handle map closing