update before UI change