Added attachHandler option