Fix attr method error when value is a boolean