Change to spawn threads instead of processes