girino's fix to check for disconnect