fixed 64bit issue with file descriptor