added additional parameter into connect method