working out the error messages