encode fixes more