fix index lookup