Added a lock for apply-changes, and finished time update