fix check for failure