moved double check inside null safe test