fix issue plugging to $document events