Fix so that scripts are submitted as jobs instead of run on head node