Trying fix for callback is not a function