functions of setting view variables added.