checktype moved below