Null point exception issue fix