stop iterating over array using for in