add if statement for displaying the loading spinner