try with resources fix