properly return connection after creating tables