adding null value checks