mistake with file descriptor of parent directory

dir_fd was wrongly used instead of fd. Fixed now