more null checking and handling.