finally added working callback for the map