refactored but added issue of reconnecting