fix huge bug, should not use for(var v in array) for array