Java script arrays started but not complete