Fixed the view gone issue for the panel