now use subprocess instead of exec