checks if out of bounds