modify logic of recycle memory