make compatible with jquery when callback name is a function