query handle deleted entries