fix UI and logic