changes to allow compiling with java 6