added begin and complete callbacks