Adding more robust reconnection check