fixed dirty memory bug d ric mhe