Check if selected is valid before deleting it.