added encoder support.