Fixed a bug in reindex call