bugfix: was not exiting with 1 when it failed