fixed polling error. Fixed file descriptor mixup.