Add proc.poll() for exit condition - fixed type