fixed mandir and made in-formula patch