add reconnect function, and js in strict mode