added/fixed to support sync via cron