basic error handling for attr() toggle()