[IMP]Improved code for fixed traceback