Fixed killing out of bounds error