improve detele document method