Fix null point exception