fix a null pointer exception due to recently change