Fixed bug in fork call