Adding alert dialog and mechanism to keep session alive