changed query to mongoose and added timer to cron job