Implement document change hook