fixing map redrawing bug