fixed the failed parent in fg, and the segfault