added nil map check