added extra logging to debug perfornamce issues