repair map.c bug