bug fix, missing id, baseclass was not passed for writeElements