Add proc.poll() for exit condition