Fix java 6 bug