Added the error message function.