We should verify as weel that callback is a function

if (callback !== undefined && typeof callback === 'function')