added max connection feature (and gofmt)