datastore: fixed bug in storing results