some extra null checking