Added begin/end contect callback