[amelia] subscript out of bounds problem