fix treatment of error condition