changed the populate table call and added a condition to check if the data array is empty, if so an empty line and empty object is created