fixed function call in fork condition