minor changes to poll function