added view scenarion and fixeds some minor bugs