parent waits for child to finish which fixes #7