made code jdk 1.6 compatible