added logic for every 5 seconds