fixed handling of null values