Fixed bug in rules, was considering empty item

We were comparing all the rules matches to consider the rule.
We were considering empty rules also which won't match. hence rule was never succeding
We now consider key of items in rule which are non empty.