Cleaned up, added attempting to reconnect