fixed refresh mechanism for the case when we delete document directory (will come handy in the future)