bug init of var inside a for solved