fixed a bug in poll