add method for java 7