added custom encoding