Added select() for read/write