make the script run from a cron job instead of an infinite loop