bug fix in order of getting data