added error checking for get_neighborhood