Made call to callback function safe.