added event publisher function for repository.