set attribute locations in code