Fixed double posting

added error catching on disconnect.