Fix file descriptor retreival