implemented update() method