destroy tables properly