change $row to $r

My IDE complained about "undefined variable $rows" so I changed it to $r.