Added the loading mask functionality