How to select Check Box items with conditions