adding stricter check for nullable types