better approach for documentSaved event