manage state and ui fixes