add pack method for proto