fix case where object indexes did not exist already when using index in ORM