flx freaks out and goes into and endless loop when test for valid FD is checked
see commentedout bit