updated for ndb