before_poll & after_poll changed