fixed checkCoordinates