Added support for java 6