fix bug with widget infinite loop