Added sorting on controller