createConditions function updated