Added sorting by attribute