Fixed compatibility issue with java 1.6