added atexit in child process
cleanup and re-organization
more code cleanup
channel closed by atexit
fixed join
more code cleanup