fixed a bug which caused a deadlock when asking for the index