the idea of encoding with bool in Const doesnt work. Restore with Var