Fixed bug with setting attribute order