use Process.wait instead of getpgid that isn't useful on linux