solve memory issue