fixed logical error causing skiped operations etc..
fixed it again