add possible IOException catch