added more tmp dir stuff, reverted some other stuff. need to modify the process_db