removed the invalid index() error