wrong table data query fixed