Updated delete row to check if row exists