Here tool.options is quite confusing. tool.active would make more sense.