introduce ordering barrier to ensure that totalCount read after count update