Fixed issue with counter not working