Fix to support java 6