rename func
mv ensuredatadir to a hook