make sure callback is a function.