solved mistake in update method