Moved traceback print to the finally block