Fixed bug with counter threading