added function view count mechanism