nightly work; database stuff