fix nullpointerException from reviews