added checks for failures