refactoring updateAttribute so it reuses code/logic from updateAttributes