Modified rake task to avoid exceeding memory