added public API for canGoBack method