Bug fix. Counter got negative values