Added sorting to user model