added 'referenceExists' method to Model.