fixed js errors for map.