fix working on Java7+