Fixed addRow function