proper null check