Added a check for blank rows