repaired problem that goes out of map