[REFACTOR] ORM: fix bug where promise would never resolve