update debug function