added callbacks to some funcitons