fix not reconnecting issue

Reconnecting was not working or tool a long time because a mistake and milliseconds calculation.