add counting for multiple connections