bug fixed in returning the table generated