database debug almost done2