Added logging to see whats going on with the DB