exit codes

in the case of an error in the script exit with a code so that os tools can catch it