change generate method, the generate method is return a process method by a msg type as key, the method as value, they set in a dic before, it has some errors and I change it for running correct