running script in a subshell