Bug fix on attribute code