Added async lock.Simplified code in viewmodels.