Fixed connection process
Tests are ok