Avoid error notice by setting null sort_by when not set.