Reconnection routine added