add counter on front-end