Callbacks for pre and post hook