added check if objects are null