simplified code for ui to db updates synchronization via promises
fixed wrong definition of db index