scala update method