removed unused printline
added proper method to check for the closed connection
Data sets changed....