v0.5.22 - clear arrays

didnt clear the arrays before reusing them