debug function added