improved compatibility with jdk6