redo database stuff