fixed bug for midrules