Fixed connection bug when coming back to the main screen and trying to connect again