Changed Connection logic. Connected in background.