removed  WIFEXITED, may introduce bug