Added reconnect to mysql