only trigger callback if it was defined