add cast to fix java error