Adapt polling function to read from local storage