Fixed using jdk7 only APIs