adding exit code on error