Fixed incompatibility with java 6