fix index keys (with ordering parameter)