Change type to type_id