updated filter functionto look at attribute definitions