corrected doConnection() implementation.