Fix bug: error message not properly accessing the model