compatibility with java before 8