added polling function