Only hide/show loading element if it exists