Sets attributes in the right order