more null checking to prevent mayhem