bugfix for java code