Trigger("click") and menu select event problem

Trigger("click") and menu select event problem

I am using a menu widget from jquery UI, so I have code like this :

$( "#menu" ).menu( { select: function() { $("#test").trigger("click"); } }); 

and as you can see, when I select an item in menu, the function does several things and it alsotriggers a click event on some buttons. The problem is, that this trigger() causes that the select function is called once again and I can't find out why. Sadly I can't give you my code, because it's to complex and it need many other functions and elements to work.