improved debug function