add backward compatibility with java 5