fix index_exists? method