changed the check to use actually check if the view is null