fix counter and i dunno about logging thing