adding closeView method