Made selection compatible with java version 7