fixed loop bug, fixed updates on set