initial correction
fixed almost all the problem except exit, need to do some research.
fixed the exit part, but not sure about the children exit(1) part