fix encode error -- def download