added check for null-reference