define cbfn outside of jquery scope

this caused some issues with cbfn not being defined