fixing errors in orm