adjusted cron jobs and placed db clean in separate function