Add asynchronous loop to wait for the local storage