fix duplicating tables