fix exception handling, bring back formatting