connect to db upon creating an instance of db class