fixed some potential NPEs during update