change encode lib, and enchancement msgs