add onfling func and remove some code, ui