change to pre hook