Quit function if no connection instead of assigning variable that