fix possible NPE, hopefully for #26