Wouldn' t it be better to use addDocument for this, since you also use deleteDocument to do the reverse?