Added event listener for app pause and resume