Fixed segfault on callback