added max memory usage (3GB), added email for failed jobs from main script