added not null in sorting