Move encoding answer under try: