fixed bug in evolve function