bug fix in all data query