added support for multiple indices