fixed the placement of pipe semaphores
fixed MAX_PROCESS