adding back button behaviour