found strange array indexing bug