more solid null checking