Fixed bug in widget data function