Add if statement when adding a row