Added success and failure checking.