null error fixed: correct hits sorting