handling remove correctly