Fixed index out of bounds issue in getNextQuestion