added print stack trace to IOException catch