added loading msg functionality