added a check to avoid errors on empty loading template