fix postgre sorting of NULL values