added error code on exit