Making sure that connection is an instance of Connection