First back button funtionality implemented.