fix a bug in map editor