[FIX] Fixed the cron issue and removed print and reused some code.