Works fine but out of bounds issue