update with memory detection.TO #3