UI and logic fixing