update array loops causing problems