Added closeConnection() method