Fixed the UI bugs