Applying sort order when the content change