define type in pre hook