Fixed error that cron job was executing wrong function