Added extra check to type