Fix scoping for toggle loader visibility