fixed the wrong fd's being used.