Use spawn instead of exec to avoid buffer overflow