Fix the connect task

Credits to @MMrko.
Merge pull request #175 from silvenon/connect

Fix the connect task