solve memory lead issue