added error checking for cp.execFile