fix a memory limit problem that error set to AM