added warning dialogue on exit, back button function and check if last view on flipper