resolved Connection variable being rewritten