These error message should be created earlier on and stored in a variable, to cut down on the duplicate code.