adding traceback printing and debug print