Adding check for inveral refresh to run only at night and some other small fixes