Fixed issue when top-most StackContext is getting deactivated