Fix callback sent to local function