handle calls to user-defined functions