checks validity of map