Hooks when initializing.