fix bugs and add Poll command