fixed bug in the selection of the main condition term