better handling null values