fix encode and method locality name