Changed == to === when checking against null