move response debugging output earlier