Avoid out of bounds error