improved disconnect method and added connect method in Robot.java