implemented update method