memory_limit issue fix