bug fix on row and column checks