fixes file path bug and handles fork storms