update the java file to make it work