changed null check