added java 8 stuff

try with resources