fix a bug of generating user model.