fix error on initial insert

I had a problem with your example insert code. This seems to fix it... for insert the session variable cmDoc need not be set.