add a setter for setting the error