added sanity check for file type/status of serial device