fixed bugs in map