added polling functionality