index bugs fixed