widget method working in model