attempt to delay functions until after socket connection happens