fix java null pointer exception BUT the real bug isn't solved yet