Security Fix

Fixed bugs with renewing connection while doing operations