moved hook from post-init to prepare