adding ThrowIfNull method