fixed default encoding
fixed re-connect method