changing debug function