static init attribute code added to writeAttribute method. still in
comments until we figure out how to realize the switch.