fixed polling bug