add row and col checking