Kotlin : Reference to array element out of bounds