fixed pub sub bug cause by multiple subscribers to document