Doing error checking with the model