added exit code 1 when things go wrong