Add attach/detach events