modify the err handling in handleRequest and do some adjust for proto.go