Fixed a bug where datamodel was not referenced correctly