fixed ridiculous array-overflow bug