added check for null value