Fix sorting header and sorting not reenabling