better poll error handling