Changed the check to check against null