move child process waiting to connection.py