Added if statement around sed up memory limit.