fixed memory leak
function that populates widgets