Added some UI logic