refactored connection process
refactored connection process
fixed bug with connection progress