Fix bug and adjust UI layout