add unbound check
codegen VarDecl works with very ugly code