adding exit codes so that this can be called from other apps