removed for in loop, and fixed set({}) issue