corrected method getConnection()