Fix incorrect attribute check