branch: change the error messages to be more meaningful