Bug problem correction on mem function