Trivial changes

-added minimizing and restoring when polling and when polling is over,
respectively