fixed out of bounds array error with stave