Added leave method in OptionsViewState t oavoid unwanted behavior