Adding update view function