fixed bug with invalid processes being logged by using a pipe, also fixed incorrect process status bug by checking the return pid from waipid