Added sorting function and invoked for categories and fields in side-bar