write error messages