Added sending of error messages