Effect of charmed meson loops on charmonium transitions