added beforeRender hook to view