make sure to clear cache array

otherwise old values can stick around if they are larger than the current array