added new parameter into connect method