updated to catch newdoc event