fixed the wrong fd's being used 2.