fixed main. wrong fork implementation