added check on null