start implementing fd duplication