fix problem with multiple rules