Dealing with error messages better