changed exception handling to hopefully print a stack trace