Changed the way the app connects and queries the db.  A bit cleaner code