improve controller exception handling