dmem error fix and finish