Fixed segfault on executing the callback.