fixed bug with updating UI and UI now updates properly