Adding memory limit so it doesn't run out of memory