used fork instead of spawning new processes