change to be compatible with java 6