use map_size guard, add test