change to atomic update of count