improve handling of null