add exit codes to mongo script