Fixing bug in map