detecting type