changed datastore to work better with db