Added functionality to handle app resume