fixed problems with null values