Fixed bug with selecting connection