fixed poll api. added sleep api