application: improved handle exceptions