We now check if the callback argument is actually a function, instead of just checking for null or undefined, this was throwing an error from time to time and it seems this fixed it.