exiting with err code