added loading function and show server online/offline