Modified the refreshing, it wouldn't remove the all docs from database.