debug improvements