improve backbutton functionality