Got a semi working program. Need to get the connection to happen every time