forking process provided wrong pid, some indent cleaning