fix out of bounds error
revert 7fb57...