trying to fix some NPEs