handling no shares in sorting