fixing exit code