view counter functional