Fixed a bug with java 6