add a loading guard