client side encoding fixes