Added a nullcheck