Modified loop to run only every 5 minutes