update code for WriteHit counter issue