Added logic that application became foreground from background.