support callbacks passed to functions