adds the logic to fetch periodiaccly when the app is in foreground