fixed compatibility issues with Java 7