fix recconect handling code