Added connection check
Added connection check when setting fields