cleaned up, select() still fails