fixing the table cell generation