Added code to handle the hardware back button clicks.