fix order by index_flag and audit bug