Add protected code for view.