BUG: not indexing correctly