use exit_group not exit(3)