You should use ```load``` instead of ```attach``` (```attach``` is an alias for backward compatibility). 


I think you should test if ```Tree``` behavior is loaded before attaching it. If it's already loaded you should call ```setup()``` with ```array('scope' => array($this->alias . '.menu_id' => $menuId))```. It's a bit longer but I think it's a cleaner way (in my opinion).