update using HashMap