More proper fix for fork pid issue