Added fix to sortby constant