changed to java 6 compatibility