use spawn instead of exec