fork then switch executed, while(!clinetfd) removed