cleaning and beginning of ui