row and column check