added login support and backbutton eventlistener