add compatibility to java 7