Properly call the lifecycle hooks.