try finally changed  to try with resources