added counters and fixed client behavior to be correct client