added row validation function and test