fixed bug with null values