finish widget function