fix perdate, pertype again(