improved subprocess call