modified to use either mysql gem