added counter in js file