Creating showLoading and hideLoading functions