fixed multiple spawning of processes