try to close table properly