added the method within connect.java