null check needed on string insert diff function