refactoring refixHead method
refactoring for calling methods and fixing ids and names when addRow