add a method for JDK7