Added destroy document hooks