Fixed the crash caused by accessing invalidated delegate.
added listener to pause ad refreshing when app goes background, and resume it vice versa.