attribute_used patch by (matthieu castet <castet.matthieu at free dot fr>)