Change order in exception handling. First print exception, than exit