Fixed bug in rules enigne