Fix incorrect attribute check

(cherry picked from commit 9bee3e1f5135a97ac683f5e6a7383b8dc2bd0ccc)
Merge pull request #392 from claco/fix-attr-check

Merged automatically by jenkins after successful build test