Add compatibility with jdk 1.6