Fix wrong usage of attr function.