use createWidget function