hopefully this resolves the arrays not clearing properly