Add init hook and function