modified attributeExists, renamed applyAttibutes methods