fixed quit segfault