some improvements for debug output