fix problem with counter