initial connection in seperate thread
minor tweaks