checks if model name can be retrieved and throw exception if not.