fixed a bug that closed the file descriptor when done with get