code fix, passing pointer to table instead of table