added stdout and stderror to written script files