fixed folding issue with java