Removed updateLocalStorage() from code. Made directive for this.