handle null values better