fix to the scipt to work with cosmic runs (do not require DB access)