added check for null