fix handling of error messages
initial