upated redeclare debug function