implemented real time UI and db updates