moved connect from constructor to seperate function