fixing check for null schema