check for invalid coordinates