fixed bug with recursive rules