validating row and column