fix bug for retrieve data