added set_error()