changed 'valid run' check and oto upload id storage to use database
instead of file system