Fixed possible segfault when handler is closing